home *** CD-ROM | disk | FTP | other *** search
/ Aminet 5 / Aminet 5 - March 1995.iso / Aminet / util / boot / vbrmov23.lha / VBRClear.asm < prev    next >
Assembly Source File  |  1994-04-24  |  2KB  |  88 lines

  1.     nolist
  2. ;:ts=8
  3. *****************************************************************
  4. *                                                               *
  5. * VBRClear version 1.0, © 1991 Arthur Hagen, All rights reserved*
  6. *                                                               *
  7. * Posted to the Public Domain.                                  *
  8. *                                                               *
  9. * Written using the Aztec Manx C 5.0 Assembler                  *
  10. *                                                               *
  11. * All comments deliberately stripped from source.               *
  12. * If you don't understand it, you should not mess with it!      *
  13. *                                                               *
  14. *****************************************************************
  15.  
  16.     include    'exec/execbase.i'
  17.     xref    _LVOOldOpenLibrary
  18.     xref    _LVOCloseLibrary
  19.     xref    _LVOSuperState
  20.     xref    _LVOOutput
  21.     xref    _LVOWrite
  22.     xref    _LVOAllocMem
  23.     xref    _LVOPermit
  24.     xref    _LVOFreeMem
  25.     list
  26.  
  27.     machine    mc68010
  28.     public    _VBRMove
  29. _VBRMove:
  30.     movea.l    (4).w,a6
  31.     lea    dosname(pc),a1
  32.     jsr    _LVOOldOpenLibrary(a6)
  33.     movea.l    d0,a5
  34.     exg.l    a5,a6
  35.     jsr    _LVOOutput(a6)
  36.     exg.l    a5,a6
  37.     move.l    d0,d7
  38.     moveq    #title_end-title,d3
  39.     lea    title(pc),a0
  40.     bsr.s    wrt
  41.     btst    #AFB_68010,AttnFlags+1(a6)
  42.     beq.s    wrong
  43.  
  44.     jsr    _LVOSuperState(a6)
  45.     moveq    #0,d1
  46.     movec    VBR,d2
  47.     movec    d1,VBR
  48.     move.l    sp,USP
  49.     movea.l    d0,sp
  50.     andi.w    #$dfff,SR
  51.     tst.l    d2
  52.     beq.s    alrdy
  53.     move.l    d2,a1
  54.     moveq    #$40,d0
  55.     rol.w    #4,d0
  56.     jsr    _LVOFreeMem(a6)
  57. quit    movea.l    a5,a1
  58.     jmp    _LVOCloseLibrary(a6)
  59.  
  60. wrong    moveq    #wrongpro_end-wrongpro,d3
  61.     lea    wrongpro(pc),a0
  62.  
  63. writerr    pea    quit(pc)
  64.  
  65. wrt    move.l    a0,d2
  66.     move.l    d7,d1
  67.     exg.l    a5,a6
  68.     jsr    _LVOWrite(a6)
  69.     exg.l    a5,a6
  70.     rts
  71.  
  72. alrdy    moveq    #already_end-already,d3
  73.     lea    already(pc),a0
  74.     bra.s    writerr
  75.  
  76. dosname    dc.b    'dos.library',0
  77.     dc.b    '$VER: '
  78. title    dc.b    'VBRClear 1.0 (21.11.91)',$0A,$0D
  79.     dc.b    'Copyright ',$A9,' 1991 Arthur Hagen.',$0A
  80. title_end
  81. already    dc.b    'VBR already clear!',$0A
  82. already_end
  83. wrongpro
  84.     dc.b    'You need 68010 or higher!',$0A
  85. wrongpro_end
  86.     even
  87.     END
  88.